package pers.vic.system.system.mapper;

import pers.vic.system.model.SysRole;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import pers.vic.base.annoation.MybatisMapper;
import pers.vic.base.mapper.BaseMapper;

/**
 * 角色表 Mapper
 * 
 * @author VIC
 */
@MybatisMapper
public interface SysRoleMapper extends BaseMapper<SysRole> {

	//新建角色和菜单关系
	void addRoleMenu(@Param("roleId")int roleId,  @Param("ids") List<Integer> needAdd);

	//删除角色和菜单的关系
	void deleteRoleMenu(@Param("roleId")int roleId,  @Param("ids")List<Integer> needDelete);

	//根据角色id删除全部关系
	void deleteRoleMenuByRoleId(@Param("roleId")int roleId);
	//查询用户的角色
	List<SysRole> findUserRole(@Param("userId")int userId);

	List<Integer> getUserRoles(@Param("userId")int userId);

	void addUserRole(@Param("userId")int userId,  @Param("ids")List<Integer> needAdd);

	void deleteUserRole(@Param("userId")int userId,  @Param("ids")List<Integer> needDelete);
	
}
